<?php
define("ROOT",				dirname(__FILE__));
define("ROOT_CONFIG",		ROOT."/config");
define("ROOT_SLIGHTPHP",	ROOT."/slightPHP/");
define("ROOT_PLIGUNS",		ROOT_SLIGHTPHP."/plugins");
define("CORE_DIR",			ROOT_SLIGHTPHP."/core");
require_once(ROOT_SLIGHTPHP."/SlightPHP.php");
function __autoload($class){
	if($class{0}=="S"){
		$file = ROOT_PLIGUNS."/$class.class.php";
	}elseif('core' == substr($class,0,4)) {//加载猪八戒网核心模块
		$file = CORE_DIR.'/'.str_replace('_','/',substr($class, 5)).'.class.php';
	}else{
		$file = SlightPHP::$appDir."/".str_replace("_","/",$class).".class.php";
	}
	if(file_exists($file)) return require_once($file);
}
spl_autoload_register('__autoload');
SlightPHP::setSplitFlag("-_.");
SDb::setConfigFile(ROOT_CONFIG. "/db.ini.php");